/*
 * marketsim-eclipsetrader
 *
 * Copyright (C) 2008-2011 Steve Phelps and John Cartlidge
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
package victria.marketsim.app;

import victria.marketsim.core.BeanFactorySingleton;
import victria.marketsim.core.MarketService;
import victria.marketsim.core.Order;

public class MarketClient {
	
	protected MarketService marketService;
	
	/**
	 * @param args
	 */
	public void initialise() {
		marketService = (MarketService) BeanFactorySingleton
				.getBean("rmiMarketService");	
		System.out.println("marketService = " + marketService);
	}
	
	public void placeOrders() {
		Order order1 = new Order();
		order1.setIsBid(true);
		order1.setPrice(10.5f);
		marketService.placeOrder(order1);
		Order order2 = new Order();
		order2.setIsBid(false);
		order2.setPrice(5f);
		marketService.placeOrder(order2);
	}
	
	public static void main(String[] args) {
		MarketClient app = new MarketClient();
		app.initialise();
		app.placeOrders();
	}

}
